package com.opp1.demo01;

public class Pet {
    public String name;

    public int age;

    //这里有一个看不到得类，无参构造，默认就有的，写了有参构造就没了


    public void shout(){
        System.out.println("叫了一声");
    }
}
/*
package com.opp1;

import com.opp1.demo01.Pet;

//一个项目应该只存在一个main方法
public class Application {
    public static void main(String[] args) {
        Pet dog = new Pet();
        dog.name = "旺财";
        dog.age = 10;
        dog.shout();
        System.out.println(dog.name);
        System.out.println(dog.age);
        Pet cat = new Pet();
        cat.name = "xiaoxu";
        cat.age  = 4;
        cat.shout();
        System.out.println(cat.name);
        System.out.println(cat.age);

    }
}
 */
